﻿using System;

namespace SnmpForm.DbWrapper.DbDataTypes
{
    /// <summary>
    /// Class1 的摘要说明
    /// </summary>
    public class User
    {
        public User()
        {
            //
            // TODO: 在此处添加构造函数逻辑
            //
        }
        public int id;
        public string username, 
            password;
        public int roletype;
        public string fullname,
            phone,
            email;
        public bool deleted;
        public string createtime,
            lastlogintime;
        public static int UNKNOW = 0;   //表示未知用户id，或者所有用户
    }

    public class Config
    {

    }

    public class Ap
    {
        public int id;
        public string floorid;    //楼层号
        public string roomid;     //房间号
        public string mark, //AP标示码
            manage_ip;  //托管IP
        public string landhcp; //lan口是否自动获取dhcp
        public string ip,
            netmask,
            gateway, 
            mac,
            software,   //os版本
            hardware;   //硬件版本
        public int snmp_version,    //snmp版本 本系统默认v3
            snmp_port;
        public string snmp_user,
            snmp_password,
            snmp_community;
        public Ap()
        {
            this.id = 0;
            this.floorid = "";
            this.roomid = "";
            this.mark = "";
            this.manage_ip = "";
            this.ip = "";
            this.netmask = "";
            this.mac = "";
            this.software = "";
            this.hardware = "";
            this.snmp_version = 0;
            this.snmp_port = 0;
            this.snmp_user = "";
            this.snmp_password = "";
            this.snmp_community = "";
        }
        public Ap Clone()
        {
            Ap rt = new Ap();
            rt.id = this.id;
            rt.floorid = this.floorid;
            rt.roomid = this.roomid;
            rt.mark = this.mark;
            rt.manage_ip = this.manage_ip;
            rt.landhcp = this.landhcp;
            rt.ip = this.ip;
            rt.netmask = this.netmask;
            rt.gateway = this.gateway;
            rt.mac = this.mac;
            rt.software = this.software;
            rt.hardware = this.hardware;
            rt.snmp_version = this.snmp_version;
            rt.snmp_port = this.snmp_port;
            rt.snmp_user = this.snmp_user;
            rt.snmp_password = this.snmp_password;
            rt.snmp_community = this.snmp_community;
            return rt;
        }
    }

    public class WirelessInfo 
    {
        public int id,
            apid;
        public bool enable;     //是否开启无线
        public string ssid,
            mac;
        public int  channel;            //信道
        public bool wds;
        public string   wirelessmode,       //无线模式
            workmode,           //工作模式
            signalstrength;     //信号强度
            //高级
        public int  power;              //发射功率
        public bool wmm,
            short_gi;
        public WirelessInfo()
        {
            ssid = "";
            mac = "";
            wirelessmode = "";
            workmode = "";
            signalstrength = "";
        }
        public WirelessInfo Clone()
        {
            WirelessInfo wi = new WirelessInfo();
            wi.apid = this.apid;
            wi.channel = this.channel;
            wi.enable = this.enable;
            wi.wds = this.wds;
            wi.id = this.id;
            wi.mac = this.mac;
            wi.power = this.power;
            wi.short_gi = this.short_gi;
            wi.signalstrength = this.signalstrength;
            wi.ssid = this.ssid;
            wi.wirelessmode = this.wirelessmode;
            wi.wmm = this.wmm;
            wi.workmode = this.workmode;
            return wi;
        }
    }

    public class WirelessSecurity
    {
        public class WEP_KEY
        {
            public string key;
            public int passwd_mode;
        }

        public int id,
            apid;
        public string secmode;      //安全模式
        public int wpa_mode;        //wpa认证类型
        public string wpa_cypher,   //wpa加密算法
            psk_key;                //wpa密码
        public int wpa_group_rekey, //wpa 组密钥更新周期

            wep_mode,               //WEP 认证方式
            wep_passwd_pattern;     //WEP密钥格式
        public int wep_key_index;
        public WEP_KEY [] wep_key = {new WEP_KEY(), 
                                    new WEP_KEY(), 
                                    new WEP_KEY(),
                                    new WEP_KEY()
                                    };
    }

    public class ClientInfo
    {
        public int id,
            apid;
        public string mac;
    }

    public class FailureInfo
    {
        public int id,
            level;
        public string failurename,
            description;
    }

    public class FailureApInfo
    {

        public FailureApInfo(int _apid,int _failureid,string _description)
        {
            apid = _apid;
            failureid = _failureid;
            description = _description;
        }
        public FailureApInfo() { }

        public int id,
            apid;
        public int failureid,
            level;
        public string failurename,
            failuredescription, //failure_info 表中描述
            description,        //assoc表中描述
            createtime;
    }

    public class LogInfo
    {
        public int id,
            userid,
            logtype,
            level;
        public string loginfo,
            datetime;

        public class LEVEL
        {
            public static int UNKNOWN = 0;   //未知级别，或者所有级别
            public static int INFO = 1;
            public static int WARMING = 2;
            public static int ERROR = 3;
        }

        public class TYPE
        {
            public static int UNKNOWN = 0;   //未知类型，或者所有类型
            public static int SYSTEM = 1;
            public static int USER = 2;
            public static int AP = 3;
        }
    }

    public class ExcleTemplate
    {
        public static string[] DBTableColunm = { "mark", "floorid", "roomid", "snmp_user", "snmp_password" };

        public static string[] ExcleTableColunm = { "路由器标识码","楼层号","房间号","SNNP账号","SNMP密码" };

        public static int FLOORD_INFEX = 1;
        public static int SNMP_PWD_INFEX = 4;
    }

    public class SearchTarget
    {
        public int id;
        public string from,
            to;
        public SearchTarget()
        {
            from = "";
            to = "";
        }
        public SearchTarget(string _from, string _to)
        {
            from = _from;
            to = _to;
        }
    }

    public class Wan
    {
       public int id,
           apid,
           type;
       public string ip,
           netmask,
           geteway,
           dns,
           standby_dbs,
           hostname,
           pppoe_account,
           pppoe_password,
           pppoe_mtu,
           pppoe_mss;
    }

    public class Dhcp
    {
        public int id,
            apid;
        public string enable,
            ipbegin,
            ipend;
        public int addressLease;
    }

    public class Advance_tools
    {
        public int id,
            apid;
        public bool led_light;
        public Advance_tools Clone()
        {
            Advance_tools at = new Advance_tools();
            at.id = this.id;
            at.apid = this.apid;
            at.led_light = this.led_light;
            return at;
        }
    }
}